home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / utilities / u620.dms / in.adf / Tips&Tricks / DOS-Intuition / ShellBack.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-29  |  947 b   |  46 lines

  1. //    ShellBack   $VER: v1.0 1992-04-28   E. Lundevall
  2. //
  3. //    Move the current shell window to the back
  4.  
  5. #include <exec/types.h>
  6. #include <exec/memory.h>
  7. #include <dos/dosextens.h>
  8. #include <dos/rdargs.h>
  9. #include <clib/exec_protos.h>
  10. #include <clib/dos_protos.h>
  11.  
  12. #define ERRTXT (UBYTE *)"Couldn't open intuition.library!\n"
  13. #define INTUINAME (UBYTE *)"intuition.library"
  14. #define KS12 33
  15.  
  16.  
  17. struct IntuitionBase *IntuitionBase;
  18. UBYTE vertxt[] = "\0$VER: v1.0_1992-04-28";
  19.  
  20.  
  21. extern struct MsgPort *MyGetConsoleTask();
  22. extern struct Window  *GetWin(BPTR);
  23.  
  24.  
  25. int main(void)
  26. {
  27.  struct Window *win;
  28.  
  29.  if(!MyGetConsoleTask())
  30.     exit(10);       // Exit if no Shell.
  31.  
  32.  IntuitionBase = (struct IntuitionBase *)
  33.                  OpenLibrary(INTUINAME,KS12);
  34.  
  35.  if(!IntuitionBase) {
  36.     Write(Output(),ERRTXT,strlen(ERRTXT));
  37.     exit(10);
  38.  }
  39.  
  40.  if((win = GetWin(Output())) != NULL)
  41.     WindowToBack(win);
  42.  
  43.  CloseLibrary((struct Library *)IntuitionBase);
  44.  return 0;
  45. }
  46.